package com.mapforge.gui;

import javax.swing.JLabel;
import javax.swing.undo.UndoableEdit;

import com.mapforge.map.tools.undo.UndoRedo;

public class UndoRedoLabel extends JLabel {
	/**
	 * Default serial version ID, here to remove warnings.
	 */
	private static final long serialVersionUID = 1L;
	UndoableEdit edit;

	public UndoRedoLabel(UndoableEdit edit) {
		this.edit = edit;
		this.setText(edit.getPresentationName());
		if (edit instanceof UndoRedo) {
			this.setIcon(((UndoRedo) edit).getIcon());
		}
	}

	public UndoableEdit getEdit() {
		return edit;
	}
}
